﻿namespace WeiTap.Validator
{
    public interface IValidatorSelector
    {
        /// <summary>
        /// 判断一个规则是否需要执行
        /// </summary>
        /// <param name="rule">规则</param>
        /// <param name="propertyPath">属性链：Customer.Address.Phone</param>
        /// <param name="context">验证上下文</param>
        /// <returns></returns>
        bool CanExecute(IValidationRule rule, string propertyPath, ValidationContext context);
    }
}